package com.wlyuan.open.domain.source.service.impl;

import com.wlyuan.open.domain.source.service.IOpenQuotationService;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author yuanzheng
 */
@Service
@Slf4j
@RequiredArgsConstructor
@Data
public class OpenQuotationServiceImpl implements IOpenQuotationService {
    /*@DubboReference(check = false)
    private final IQuotationService quotationService;
    @DubboReference(check = false)
    private final ITemplateService templateService;

    @Override
    public Long sync(OpenQuotationSyncDTO source) {
        var creation = QuotationAssembler.assemble(source);
        logger.info("同步报价参数：{},{}", source.getSourceKey(), JSON.toJSON(creation));
        //return quotationService.rewrite(creation);
        return null;
    }

    @Override
    public Long sync(OpenTemplateSyncDTO source) {
        var creation = TemplateAssembler.assemble(source);
        logger.info("同步合约参数：{},{}", source.getSourceKey(), JSON.toJSON(creation));
        var template = templateService.rewrite(creation);
        AssertUtils.assertNotNull(template, new SourceValueErrorException("创建合约失败"), source);
        return template.getTemplateId();
    }

    @Override
    public Long sync(OpenCombineQuotationSyncDTO source) {
        var creation = QuotationAssembler.assemble(source);
        logger.info("同步合单报价参数：{},{}", source.getSourceKey(), JSON.toJSON(creation));
        //return quotationService.rewrite(creation);
        return null;
    }*/
}
